package com.example.gokuplayalong.service.privateclient.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class PrivateInterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        WebMvcConfigurer.super.addInterceptors(registry);

        registry.addInterceptor(new PrivateInterceptor())
                .addPathPatterns("/private/client/**")
                .excludePathPatterns("/private/client/login")
                .excludePathPatterns("/private/client/admin/**");
    }
}
